<?php

/* 
 * 模块表
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
class storyModuleModel extends db_help
{
    public $keyFields = 'mid';//设置主键
    public function __construct() {
        parent::__construct();
        $this->table_name = $this->table('story_module');
    }
    public static function load(){
        return new self();
    }
    /**
     * 获取名称
     * @param type $mid
     * @return type
     */
    public function getName($mid) {
        $where = array(
            'mid' => $mid,
        );        
        return $this->getOne('mname', $where);
    }

    /**
     * 以来源ID获取模块信息
     * @param int $sid 来源ID
     * @return array 二维
     */
    public function getInfoBySid($sid) {
        $where = array(
            'sid' => $sid,
        );
        return $this->getAll(null, $where);
    }
    /**
     * 获取SID
     * @param type $sid
     * @return type
     */
    public function getSid($sid) {
        $where = array(
            'sid' => $sid,
        );
        return $this->getOne('sid', $where);
    }
}
